package com.yswee.mallnavi.db;

import com.yswee.framework.Application;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class DataBaseHelper extends BaseDataBaseHelper {

	private static final String DataBaseName = "database.db";
	private static final int DataBaseVersion = 1;
	
	private static final byte[] mLock = new byte[0];
	private static DataBaseHelper mInstance = null;
	public final static DataBaseHelper get() {
        synchronized (mLock) {
            if (mInstance == null) {
                mInstance = new DataBaseHelper(Application.get());
            }
            return mInstance;
        }
    }
	
    protected DataBaseHelper(Context context) {
		super(context);
	}

	@Override
	protected String getDataBaseName() {
		return DataBaseName;
	}

	@Override
	protected int getDataBaseVersion() {
		return DataBaseVersion;
	}

	@Override
	protected void createDataBase(SQLiteDatabase db) {
		
	}

	@Override
	protected void updateDataBase(SQLiteDatabase db, 
			int oldVersion, int newVersion) {
		/*
		int curVersion = oldVersion;
    	if(curVersion <= 1) {
    		DataBaseUpdate.update1to2();
    		curVersion = 2;
    	}
    	if(curVersion == 2) {
    		DataBaseUpdate.update2to3();
    		curVersion = 3;
    	}
    	*/
	}

	@Override
	protected void clearDataBase(SQLiteDatabase db) {
        String[] tables = new String[] { 
        	
        };
        for (String table : tables) {
        	truncate(db, table);
        }
	}

}
